const { Schema } = require('./config')
const ObjectId = Schema.Types.ObjectId
const ScoreSchema = new Schema(
  {
    course: {
      type: ObjectId,
      ref: 'courses'
    },
    teacher: {
      type: ObjectId,
      ref: 'users'
    },
    student: {
      type: ObjectId,
      ref: 'users'
    },
    score: {
      performance: {type:Number,default:0},
      operation: {type:Number,default:0},
      experiment: {type:Number,default:0},
      attendance: {type:Number,default:0},
      other: {type:Number,default:0},
      paper: {type:Number,default:0}
    }
  },
  { versionKey: false }
)

module.exports = ScoreSchema
